package com.rongc.client.freight.business.supply.buz;

import android.content.Context;

import com.rongc.client.freight.R;
import com.rongc.client.freight.base.model.BaseDic;
import com.rongc.client.freight.base.view.widget.CJRow.ARResponse;
import com.rongc.client.freight.utils.dic.impl.Field;
import com.rongc.client.freight.utils.dic.impl.FieldConstant;
import com.rongc.client.freight.utils.dic.impl.Table;

/**
 * Created by ccqx on 2017/7/1.
 */

public class SupplyBuz {
    public static Table getJBXXTable(Context context) {
        Table table = new Table();
        table.addField(new Field("loadTime", context.getResources().getString(R.string.supply_create_date), 1, FieldConstant.SHOWTYPE_JUMP_PW,FieldConstant.INPUTTYPE_LONG_DATE,FieldConstant.EDIT_MODE,FieldConstant.INPUTSTYLE_DATATIMESTYLE,1, R.mipmap.xiadan_icon_1));
        table.addField(new Field("start_ssq", context.getResources().getString(R.string.supply_create_departure), 2, FieldConstant.SHOWTYPE_JUMP_ACTIVITY,FieldConstant.INPUTTYPE_LONG_DATE,FieldConstant.EDIT_MODE,FieldConstant.INPUTSTYLE_DATATIMESTYLE,1, R.mipmap.xiadan_icon_2));
        table.addField(new Field("end_ssq", context.getResources().getString(R.string.supply_create_destination), 3, FieldConstant.SHOWTYPE_JUMP_ACTIVITY,FieldConstant.INPUTTYPE_LONG_DATE,FieldConstant.EDIT_MODE,FieldConstant.INPUTSTYLE_DATATIMESTYLE,1, R.mipmap.xiadan_icon_3));
        table.addField(new Field("carLength", context.getResources().getString(R.string.supply_create_length), 4, FieldConstant.SHOWTYPE_JUMP_ACTIVITY,FieldConstant.INPUTTYPE_LONG_DATE,FieldConstant.EDIT_MODE,FieldConstant.INPUTSTYLE_DATATIMESTYLE,2, R.mipmap.xiadan_icon_4));
        table.addField(new Field("carModels", context.getResources().getString(R.string.supply_create_model), 5, FieldConstant.SHOWTYPE_JUMP_ACTIVITY,FieldConstant.INPUTTYPE_LONG_DATE,FieldConstant.EDIT_MODE,FieldConstant.INPUTSTYLE_DATATIMESTYLE,2, R.mipmap.xiadan_icon_5));
        table.addField(new Field("goods", context.getResources().getString(R.string.supply_create_name), 6, FieldConstant.SHOWTYPE_NO_CLICK,FieldConstant.INPUTTYPE_SINGLE,FieldConstant.EDIT_MODE,FieldConstant.INPUTSTYLE_TEXTSTYLE,3, R.mipmap.xiadan_icon_6));
        table.addField(new Field("weights", context.getResources().getString(R.string.supply_create_weight), 7, FieldConstant.SHOWTYPE_NO_CLICK,FieldConstant.INPUTTYPE_SINGLE,FieldConstant.EDIT_MODE,FieldConstant.INPUTSTYLE_NUMBERSTYLE,3, R.mipmap.xiadan_icon_7));
        table.addField(new Field("dulk", context.getResources().getString(R.string.supply_create_volume), 8, FieldConstant.SHOWTYPE_NO_CLICK,FieldConstant.INPUTTYPE_SINGLE,FieldConstant.EDIT_MODE,FieldConstant.INPUTSTYLE_NUMBERSTYLE,3, R.mipmap.xiadan_icon_8));
        table.addField(new Field("message", context.getResources().getString(R.string.supply_create_leave), 9, FieldConstant.SHOWTYPE_JUMP_ACTIVITY,FieldConstant.INPUTTYPE_LONG_DATE,FieldConstant.EDIT_MODE,FieldConstant.INPUTSTYLE_NUMBERSTYLE,3, R.mipmap.xiadan_icon_9));

        table.addField(new Field("sj_price", 10,false));
        table.addField(new Field("freight", 10,false));
        table.addField(new Field("startLon",10, false));
        table.addField(new Field("startLat", 10,false));
        table.addField(new Field("startPlace", 10,false));
        table.addField(new Field("endLon", 10,false));
        table.addField(new Field("endLat", 10,false));
        table.addField(new Field("endPlace", 10,false));
        table.addField(new Field("userId", 10,false));

        table.getField("carLength").setFunctionNo(BaseDic.DicsType.LENGTH_TYPE);
        table.getField("carModels").setFunctionNo(BaseDic.DicsType.MODEL_TYPE);


        return table;
    }

    public static ARResponse getMockBaseResponse(){

        String str = "{\"data\":{\"loadTime\":\"\",\"startPlace\":\"\"," +
                "\"endPlace\":\"\",\"carLength\":\"\",\"carModels\":\"\",\"goods\":\"\"," +
                "\"weights\":\"\",\"dulk\":\"\",\"message\":\"\",\"freight\":\"0\",\"sj_price\":\"0\"}}";
        return new ARResponse(str);
    }

}
